}
_onCaptureButtonClicked() {
+ this._saveScreenshot();
+
+ // TODO: screencasting.
+
+ this.close();
+ }
+
+ _saveScreenshot() {
global.display.get_sound_player().play_from_theme(
'screen-capture', _('Screenshot taken'), null);
if (this._selectionButton.checked || this._screenButton.checked) {
const content = this._stageScreenshot.get_content();
- if (!content) {
- // Failed to capture the screenshot for some reason.
- this.close();
- return;
- }
+ if (!content)
+ return; // Failed to capture the screenshot for some reason.
const texture = content.get_texture();
const stream = Gio.MemoryOutputStream.new_resizable();
return;
const content = window.windowContent;
- if (!content) {
- this.close();
+ if (!content)
return;
- }
const texture = content.get_texture();
const stream = Gio.MemoryOutputStream.new_resizable();
logError(err, 'Error capturing screenshot');
});
}
-
- this.close();
}
vfunc_key_press_event(event) {